package org.example.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : xuzhennan
 * @Project : 787k-cloud
 * @Package : config
 * @email : xuzhennan@58.com
 * @date : 2021年08月29日 上午9:12
 */
@Configuration
public class PageConfig {
    /**
     * 最新配置如下 我的版本号不支持 <dependency> <groupId>com.baomidou</groupId>
     * <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.0.5</version> </dependency>
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
}
